<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript" charset="UTF-8" src="../static/jquery-3.5.1.js"></script>
    <link rel="shortcut icon" href="#"/>
    <script type="text/javascript" charset="UTF-8">

        $(document).ready(function () {
            $("#btn").on('click', function () {
                $.ajax({
                    url: "http://localhost:8081/getCurFileList",
                    data: {},
                    type: "GET",
                    success: function (data) {
                        console.log(data);
                        let content = '';
                        for (let i=0; i<data.files.length; i++){
                            content+=data.files[i]+"<br/>"
                        }
                        $("p").html(content);
                    }
                });
            });
        })

    </script>
</head>
<body>
<div>
    <button id="btn"> 获取服务器文件信息</button>
    <!--    <input onclick="myAlert()" type="button" value="点我"/>-->
    <p>
    </p>
    <form action="http://localhost:8081/download" method="post" enctype="application/x-www-form-urlencoded">
        下载文件 <input type="text" name="fileName">
        <input type="submit" value="提交">
    </form>
</div>
</body>


</html>